package vn.vfriends.soffice.service.impl;

import java.util.List;
import javax.inject.Inject;
import vn.vfriends.soffice.entity.Menu;
import vn.vfriends.soffice.entity.Permission;
import vn.vfriends.soffice.entity.User;
import vn.vfriends.soffice.facade.UserFacade;
import vn.vfriends.soffice.service.UserService;

/**
 *
 * @author chaungoctuan@gmail.com
 */
public class UserServiceImpl implements UserService {

    @Inject private UserFacade userFacade;
    
    @Override
    public void create(User user) throws Exception {
        userFacade.create(user);
    }

    @Override
    public void edit(User user) throws Exception {
        userFacade.edit(user);
    }

    @Override
    public void remove(User user) throws Exception {
        userFacade.remove(user);
    }

    @Override
    public User find(Object id) {
        return userFacade.find(id);
    }

    @Override
    public List<User> findAll() {
        return userFacade.findAll();
    }

    @Override
    public User findByUsername(String username) {
        return userFacade.findByUsername(username);
    }

    @Override
    public List<User> findRange(int[] range) {
        return userFacade.findRange(range);
    }

    @Override
    public int count() {
        return userFacade.count();
    }

    @Override
    public List<String> findURLsOfUser(User user) {
        return userFacade.findURLsOfUser(user);
    }

    @Override
    public List<Menu.Code> findMenusOfUser(User user) {
        return userFacade.findMenusOfUser(user);
    }

    @Override
    public List<Permission.Code> findPermissionsOfUser(User user) {
        return userFacade.findPermissionsOfUser(user);
    }

}
